﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="JKF.Web.Login" %>

<%@ Import Namespace="JKF.Substructure" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">

    <title><%=SysConfig.ElementValue("webname") %></title>
    <link href="App_Themes/Theme2/Include.css"   rel="stylesheet" type="text/css" />
    <%=this.RegScript("~/js/jquery.js") %>
    <%=this.RegScript("~/js/jquery.validate.js")%>
    <%=this.RegScript("~/js/css.js")%>
    <%=this.RegScript("~/js/RemberLogin.js")%>
    <style type="text/css">
        .downie p
        {
               font-weight:
        }
    </style>
    <script type="text/javascript">
        try { //放在按浏览器退回键还能回到登录页
            history.go(1);
        }
        catch (e) {
        }
       

        $(function () {
           
            (function () {//浏览器检测
                var br = jQuery.browser;
                var name = '';
                if (br.safari) {
                    name = 'safari';
                }
                if (br.opera) {
                    name = 'opera';
                }
                if (br.msie) {
                    name = 'msie';
                }
                if (br.mozilla) {
                    name = 'mozilla';
                }
                var pd = {
                    Browser: name,
                    Height: screen.height,
                    Version: br.version,
                    Width: screen.width
                }
                var perfect = pd.Browser == 'msie' && pd.Version == '8.0';
                if (!perfect) {
                    var p = $('div.downie p');
                    for (var i = 0; i < 18; i++) {
                        if (i % 2 == 0) {
                            setTimeout(function () {
                                p.css({ color: '#ff0000', 'fontWeight': 'bold' });
                            }, i * 1000);
                        } else {
                            setTimeout(function () {
                                p.css({ color: '#000000', 'fontWeight': 'normal' });
                            }, i * 1000);
                        }
                    }
                }
            })();

        }); 
           
    </script>
     <script type="text/javascript">
         alxVr.push({
             id: 'txtUserName',
             rule: function (jd) {
                 return jd.val().length > 0;
             },
             msg: '用户名不能为空'
         });
         alxVr.push({
             id: 'txtPassword',
             rule: function (jd) {
                 return jd.val().length > 0;
             },
             msg: '密码不能为空'
         });        
    </script>

    <script type="text/javascript">
        $(function () {
           
            $('#btnLogin').click(function () {
                if ($.validateAll()) {
                    $('#btnLogin').attr('disabled', 'disabled');

                    $.ajax({
                        type: 'post',
                        dataType: 'json',
                        url: '<%=AppPath %>/do/Sys/Login.do',
                        data: { ActionName: 'Login', LoginName: $('#txtUserName').val(), Pwd: $('#txtPassword').val(), type: "1" },
                        success: function (data) {
                            if (data.IsSucc) {
                                if ($("#chkRemember").attr("checked")) //登录成功，如果选中记录登录状态则设置cookie
                                {
                                    setCookie('c_userName', $('#txtUserName').val(), 'c_password', $('#txtPassword').val(), 10);
                                }
                                else
                                    cleanCookie("c_userName", "c_password");
                                window.location.href = 'Main.aspx';
                            }
                            else {
                                alert(data.Message);
                                cleanCookie("c_userName", "c_password"); //登录失败,如果存在cookie则清除cookie
                                $('#txtPassword').val('').focus();
                                $('#btnLogin').removeAttr('disabled');
                            }
                        }
                    });
                }
            });
            $('body').keydown(function (event) {
                if (event.keyCode == 13) {
                    $('#btnLogin').click();
                }
            });
            $('#txtUserName').focus();

            checkCookie("c_userName", "c_password"); //如果记录了登录状态，则直接登录成功
        });
        function btnLogin_onclick() {

        }
    </script>
</head>
<body class="login_body_bg">
    <div class="login_warpper" >
      <div class="login">
         <div class="login_1">
             <img src="App_Themes/Theme2/images/login_01.png"  width="641" height="89" />
             <img src="App_Themes/Theme2/images/login_03.png" width="641" height="112" />
             <img src="App_Themes/Theme2/images/login_05.png" width="641" height="106" />
             <img src="App_Themes/Theme2/images/login_06.png" width="641" height="88" />
             <img src="App_Themes/Theme2/images/login_07.png" width="641" height="105" />    
         </div>

         <div class="login_2">
         <img src="App_Themes/Theme2/images/login_02.png" width="361" height="132" />
         <div class="login_4">
             <div>
                   <ul>
                      <li><span class="left_txt"></span><span><input  id="txtUserName" type="text" class="login_input_new"/></span></li>
                      <li><span class="left_txt"></span><span><input id="txtPassword" type="password" class="login_input_new"/></span></li>
                      <li style=" height:40px; line-height:40px;color:#325681"><span class="left_txt">&nbsp;</span><span>
                           <input id="chkRemember" type="checkbox" value="" /> 记住我的登录状态</span>
                      </li>                 
                      <li>
                          <span class="left_txt">&nbsp;</span>
                          <span><input id="btnLogin" onclick="return btnLogin_onclick()" type="button" class="login_btn" />
                          <!--<a href="#" class="f12blue">忘记密码？</a>--></span>
                      </li>
                   </ul> 
                   <br clear="all" />
            </div>
         </div>
         <img src="App_Themes/Theme2/images/login_08.png" width="361" height="105" />
         </div>
         <br clear="all" />
        </div>

        <div class="login_5">
            <a href="#" class="link">
            <img src="App_Themes/Theme2/images/01.gif" width="73" height="69" /> 
            <p>中华医学会</p>
            </a>
             <a href="#" class="link">
            <img src="App_Themes/Theme2/images/02.gif" width="73" height="69" /> 
            <p>保健协会</p>
            </a>
             <a href="#" class="link">
            <img src="App_Themes/Theme2/images/03.gif" width="73" height="69" /> 
            <p>高新企业</p>
            </a>
             <a href="#" class="link">
            <img src="App_Themes/Theme2/images/04.gif" width="73" height="69" /> 
            <p>疾控中心</p>
            </a>
             <a href="#" class="link">
            <img src="App_Themes/Theme2/images/05.gif" width="73" height="69" /> 
            <p>中医药大学 </p>
            </a>
             <a href="#" class="link">
              <img src="App_Themes/Theme2/images/06.gif" width="73" height="69" /> 
            <p>亚运会</p>
            </a>   
        </div>
    </div>
</body>
